#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QString>
#include <QMediaPlayer>
#include <QMediaPlaylist>
#include <QListWidgetItem>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    void initplayer();//初始化音乐播放器函数
    void addMusic();//添加音乐文件

private slots:
    void on_pushButton_look_clicked();

    void on_listWidget_itemDoubleClicked(QListWidgetItem *item);
    void on_playerPositionChanged(qint64 position);//定义音乐播放器位置条

    void on_horizontalSlider_sliderReleased();

    void on_pushButton_pre_clicked();

    void on_pushButton_change_clicked();

    void on_pushButton_next_clicked();

    void on_comboBox_currentIndexChanged(int index);

    void on_playlistIndexChanged(int index);

private:
    Ui::MainWindow *ui;
    QString path;
    QStringList musicFilses;
    QMediaPlayer *player;
    QMediaPlaylist *playlist;
};
#endif // MAINWINDOW_H
